<div id="fb-root">
    {% if is_https %}<script src="https://connect.facebook.net/en_US/all.js" type="text/javascript"></script>{% else %}<script src="http://connect.facebook.net/en_US/all.js#xfbml=1" type="text/javascript"></script>{% endif %}
</div>
<script type="text/javascript">
  // initialize the library with the API key
  FB.init({ apiKey: '{{ facebook_api_key }}', status: true, cookie: true, xfbml: true});

  function facebookConnect(form){
	  FB.init({ apiKey: '{{ facebook_api_key }}', status: true, cookie: true, xfbml: true});
      function handleResponse(response){
          form.submit();
      }
      FB.login(handleResponse,{perms:''});/*,{perms:'email,publish_stream,publish_stream,sms,offline_access,email,read_stream,status_update,etc'}*/
  }

</script>
